package mains;

import java.util.Iterator;
import cartes.Carte;
import cartes.Denomination;

public class QuinteRoyale extends AbstractAnalyseurRang {

	@Override
	public boolean reconnaitreMain(ReqAnalyseMain ram) {
		if(!estMemeCouleur(ram.getMain()))
			return false;
		
		if(!estEnSerie(ram.getMain()))
			return false;
		
        Iterator<Carte> it = ram.getMain().iterator();
        Carte c;
        boolean contientAs = false;
        while(it.hasNext() && !contientAs)
        {
        	c = it.next();
            contientAs = c.getDenomination().equals(Denomination.AS);
        }
        
        return contientAs;
	}

}
